<?php
    $object = $this->getObject();
    $labels = $object['labels'];
   
    $product = $object['product'];
    $processor = Mage::getModel('productlabels/filter');
    $objectFilter = new Varien_Object();
   
    $objectFilter->setData('product',$product);
    //print_r($processor);exit;
    //echo $processor->filter($object);
    
    
    //echo $background;exit;
    //echo $label->getTexthtml();
    //echo $product->getName().'label';

?>
<ul class="productlabels_icons">
    <?php foreach($labels as $label):?>
    <?php

    if($background = $label->getBackground())
    {
        $src = Mage::getBaseUrl("media").'em_productlabels'.'/'.'background'.'/'.$background;
        $background = "style='background:url(\"$src\") no-repeat scroll 0 0 transparent'";
    }
    ?>
    <li <?php if($classCss = $label->getCssClass()):?>class="<?php echo $classCss;?>"<?php endif;?> <?php echo $background;?>>
        <?php $image = $label->getImage();?>
        <?php if($image && $image != 'nopic'):?>
        <img alt="" src="<?php echo Mage::getBaseUrl("media").'em_productlabels'.'/'.'image'.'/'.$image;?>"/>
        <?php endif;?>
        <p>
            <?php $objectFilter->setData('text',$label->getTexthtml());?>
            <?php echo $processor->filter($objectFilter);?>
        </p>
    </li>
    <?php endforeach;?>
</ul>